package com.bnc.menu.attendance;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.bnc.dto.AttendDTO;
import com.bnc.dto.PlanDTO;
import com.bnc.manager.JDBCManager;
import com.bnc.props.GlobalData;

public class AttendUpdate {

	private JDBCManager jdbcManager;
	private PreparedStatement pstmt;
	
	public AttendUpdate(){
		
		jdbcManager = JDBCManager.getInstance();
		
		String writer = GlobalData.memberDTO.getId();
		String date = Attendance.year+"."+Attendance.months+"."+Attendance.days;
		String time_in = Attendance.timein;
		String time_out = Attendance.timeout;
		
		
		String query = "update tbl_attend set attend_time_out = '"+time_out+"' where attend_id = '"+writer+"' and attend_date = '"+date+"' and attend_time_in = '"+time_in+"'";
		
		pstmt = jdbcManager.prepareStatement( query );
		
		try {
			pstmt.executeUpdate();
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			try {
				if(pstmt != null)
				pstmt.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}		
		
		}
	}
}
